package com.loansystem.service.user.impl;


import com.loansystem.bean.user.Loans;
import com.loansystem.bean.user.User;
import com.loansystem.bean.user.User_Rule_VO;
import com.loansystem.dao.user.UserMapper;
import com.loansystem.service.user.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMapper;

    @Override
    public User getUserByUsername(String email) {
        return userMapper.getUserByUsername(email);
    }

    @Override
    public User getUserById(int user_id) {
        return userMapper.getUserById(user_id);
    }

    @Override
    public User_Rule_VO getRuleName(String user_mail) {
        return userMapper.getRuleName(user_mail);
    }

    @Override
    public int updataPwd(String user_pwd, int user_id) {
        return userMapper.updataPwd(user_pwd, user_id);
    }

    @Override
    public int updataUserInfo(User user) {
        return userMapper.updataUserInfo(user);
    }

    @Override
    public int submitLoansInfo(Loans loans) {
        return userMapper.submitLoansInfo(loans);
    }

    @Override
    public List<Loans> getLoansInfo(int user_id) {
        return userMapper.getLoansInfo(user_id);
    }

    @Override
    public int addUser(User user) {
        return userMapper.addUser(user);
    }

    @Override
    public int updataByUserId(int user_id) {
        return userMapper.updataByUserId(user_id);
    }
}
